package com.cy.store.mapper;

import com.cy.store.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
@Mapper
public interface UserMapper {
    /***通过用户名获取用户数据
     *
     * @param username
     * @return
     */
    @Select("select * from t_user where username=#{username};")
    User getByUserName(String username);

    /***增添用户
     *
     * @param user
     * @return
     */
    @Insert("insert into t_user(username, password, salt, phone," +
            " email, gender, avatar,is_delete, created_user, " +
            "created_time, modified_user, modified_time) values " +
            "(#{username},#{password}, #{salt}, #{phone}, #{email}," +
            " #{gender}, #{avatar}, #{isDelete}, #{createdUser}, " +
            "#{createdTime}, #{modifiedUser}, #{modifiedTime});")
    int insert(User user);

}
